<script setup lang="ts" name="CCChildPage_Event">
import { ref } from "vue";

const toy = ref("凹凸慢");

// 声明事件
const emit = defineEmits(["send-toy"]);
</script>

<template>
  <div class="bg-orange-100 p-6 my-6">
    <h2 class="text-xl">子组件</h2>
    <div>玩具：{{ toy }}</div>
    <div>
      <button @click="emit('send-toy', toy)" class="px-1 py-0.5 border bg-gray-50">
        把玩具给父组件
      </button>
    </div>
  </div>
</template>
